﻿Ext.define("entgpv11.store.Region", {
    extend: "Ext.data.Store",
    requires: [
        'Ext.data.proxy.LocalStorage'
    ],
    config: {
        model: "entgpv11.model.Region",
        proxy: {
				type:"ajax",
				url: Ext.APP_GLOBAL.getServiceUrl() + "GetRegiones",
				scriptTag: true,
                actionMethods:
				{
					read: 'POST'
				},
				extraParams:
				{
					type:"1"
				},
                reader: {
				  type: 'json',
				  rootProperty:'DataTable'
			    }
		},
		autoLoad: false,
		sorters: [{ property: 'region', direction: 'DESC'}],
        grouper: {
            sortProperty: "region",
            direction: "DESC",
            groupFn: function (record) {
                if (record && record.data.region) {
                    return record.data.region;
                } else {
                    return '';
                }
            }
        }
    }
});
